<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/jsp/adminjsp/taglibs.jsp"%>
<!DOCTYPE html>
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<title>人人自由任务后台管理系统</title>
		<link rel="stylesheet" href="../../styles/adminCss/backstage.css">
		<script type="text/javascript" src="../../javascript/adminJs/jquery.min.js"></script>
		<script type="text/javascript">
		$(document).ready(function(){ 
			$("#taskCateList").change(function (){
				var id = $("#taskCateList").val();
				alert(id);
				if(id !="" || id != null ){
					$.get("/adminjsp/selectTaskByCate?cateId="+id,function(data){});
				}
			});
		})
		</script>
	</head>
	<body>
		<jsp:include page="top.jsp"></jsp:include>
		<div class="adminMain">
		<div class="adminLeft">
		<jsp:include page="left.jsp"></jsp:include>
		</div>
		<div class="adminRight">
	    <div class="content clearfix">
	        <div class="main">
	            <!--右侧内容-->
	            <div class="cont">
	                <div class="title">任务列表</div>
	                <div class="details">
	                    <div class="details_operation clearfix">
	                        <div class="bui_select">
	                            <a href="addTask">
	                            <input type="button" value="发布任务" class="add">
	                            </a>
	                        </div>
	                        <div style="display:none;" class="fr">
	                            <div class="text">
	                                <span>任务类别：</span>
	                                <div class="bui_select">
	                                    <select name="taskCateList" id="taskCateList" class="select">
	                                    	<option value=""></option>
	                                    <c:forEach var="data" items="${taskCateInfoList}" varStatus="status">
	                                        <option value="${data.cateId}">${data.cateName}</option>
	                                     </c:forEach>   
	                                    </select>
	                                </div>
	                            </div>
	                        </div>
	                    </div>
	                    <!--表格-->
	                    <table class="table" cellspacing="0" cellpadding="0">
	                        <thead>
	                            <tr>
	                                <th width="15%">任务编号</th>
	                                <th width="40%">任务名称</th>
	                                <th width="15%">发布时间</th>
	                                <th>操作</th>
	                            </tr>
	                        </thead>
	                        <tbody>
	                        	<c:forEach var="data" items="${adminTaskInfList}" varStatus="status">
		                            <tr>
		                                <!--这里的id和for里面的c1 需要循环出来-->
		                                <td><input type="checkbox" id="c1" class="check"><label for="c1" class="label">${data.taskId}</label></td>
		                                <td>${data.title}</td>
		                                <td>${data.taskDate}</td>
		                                <td align="center">
		                                <a href="modifyTask?taskId=${data.taskId}" class="btn">修改</a>
		                                <a href="deleteTask?taskId=${data.taskId}" onClick="return window.confirm('确认要删除选中的信息')" class="btn">删除</a>
		                                </td>
		                            </tr>
	                         	 </c:forEach>  
	                        </tbody>
	                    </table>
	                </div>
	            </div>
	        </div>
	        
	        
	        </div>
	    </div>
	    </div>
	</body>
</html>